#include "reminderitem.h"

#include <QtGui>

ReminderItem::ReminderItem(Reminder* r) : QStandardItem()
{
    if(r){
        this->setReminder(r);
        this->setText(r->getName());
        setData(r->getName(), 1002);
    }
    this->setEditable(false);
}

ReminderItem::~ReminderItem()
{
}

ReminderCalendar::ReminderCalendar(QWidget *parent) : QCalendarWidget(parent)
{
}

ReminderCalendar::~ReminderCalendar()
{
}

void ReminderCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
{
    if(date == QDate::currentDate()){
        painter->save ();
        painter->fillRect (rect, (date == selectedDate() ? palette().color(QPalette::Highlight) : Qt::lightGray));
        /*
        QFont f(painter->font());
        f.setBold(true);
        painter->setFont(f);
        */
        painter->drawText (rect, Qt::AlignCenter | Qt::AlignHCenter, QString::number (date.day ()));
        painter->restore ();
    }
    else QCalendarWidget::paintCell(painter, rect, date);
}


